<template>
  <div class="vcu-charts-parent" :style="parentStyle">
    <base-echarts
      v-if="isHasData"
      :init-options="initOptions"
      :options="options"
      :autoResize="true"
      :theme="theme"
      :chart-height='height'
      :ec.sync="ec"
      v-on="$listeners"
    />
    <slot v-if="!isHasData && !showLoading">
      <empty-data :empty-text="emptyText"/>
    </slot>
    <loading-chart v-if="showLoading" />
  </div>
</template>

<script>
import Core from '../mixins/core'
import { options } from '../base-options'

export default {
  mixins: [Core],
  data () {
    return {
      options,
      initOptions: {
        renderer: 'canvas'
      }
    }
  }
}
</script>
